

public class Main {
    

    public static void main(String[] args) {
        float principal = (float) Console.readNumber("贷款本金", 1_000, 1_000_000);
        float annualInterst = (float) Console.readNumber("年化利率%", 0, 100);
        byte years = (byte) Console.readNumber("贷款年数", 0, 30);

        var calculator = new MortageCalculator(principal,annualInterst,years);
        var report = new MortgageReport(calculator);
        report.printBalance();
        report.printMortgage();
    }
}